<<template>  
    <view>  
        <view>你的页面df内容{{xx}}</view>  
        <scan-code></scan-code>  
		<view>{{xx}}</view>
    </view>  
</template>  

<script>  
import scanCode from "@/components/scan-code/scan-code.vue";  
export default {  
    components: { scanCode },  
    data() {  
        return {
			xx: '1231645'
		}  
    },
    onShow: function() {  
        var _this = this  
        uni.$off('scancodedate') // 每次进来先 移除全局自定义事件监听器  
        uni.$on('scancodedate',function(data){  
            console.log('你想要的code：', data.code)  
			this.xx = data.code
        }.bind(this))  
    }  
} 
</script>
<style></style>